package com.lzy.mall.product.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author lzy
 * @date 2021/9/9 16:56
 */
//@Configuration
public class MyRedisConfig {

    //@Bean(destroyMethod = "shutdown")
    public RedissonClient redisson(){
        Config config = new Config();
        config.useClusterServers()
                .addNodeAddress("redis://110.42.235.109:6379");
        RedissonClient redissonClient = Redisson.create(config);
        return redissonClient;
    }
}
